﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Framework.Data;
using Ue.Infrastructure.EntityFactoryFramework;
using Ue.Qcdz.Domain.ShopSinglePages;
namespace Ue.Qcdz.Repositories.ShopSinglePages
{
    public class ShopSinglePageFactory : IEntityFactory<ShopSinglePage>
    {

        internal class FieldNames : FieldNamesBase
        {
            public const string Title = "Title";
            public const string ShopId = "ShopId";
            public const string ImageUrl = "ImageUrl";
            public const string Content = "Content";
            public const string Remark = "Remark";
            public const string DisplayOrder = "DisplayOrder";
            public const string Status = "Status";
        }





        #region IEntityFactory<ShopSinglePage> 成员

        public ShopSinglePage BuildEntity(System.Data.IDataReader reader)
        {
            return new ShopSinglePageFroxy(
                   reader.Get<Guid>(ShopSinglePageFactory.FieldNames.EntityKey),
                   reader.Get<string>(ShopSinglePageFactory.FieldNames.Title),
                   reader.Get<string>(ShopSinglePageFactory.FieldNames.ImageUrl), 
                   reader.Get<string>(ShopSinglePageFactory.FieldNames.Content),
                   reader.Get<string>(ShopSinglePageFactory.FieldNames.Remark),
                   reader.Get<int>(ShopSinglePageFactory.FieldNames.DisplayOrder),
                   reader.Get<int>(ShopSinglePageFactory.FieldNames.Status),
                   reader.Get<DateTime>(ShopSinglePageFactory.FieldNames.CreateOn)
            );
        }

        #endregion
    }
}
